package cn.iocoder.yudao.module.trade.verify.dal.mysql;

import cn.iocoder.yudao.framework.business.basic.dao.query.CoreLambdaQueryWrapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.verify.dal.dataobject.TradeVerifyRecordDO;
import cn.iocoder.yudao.module.trade.verify.vo.TradeVerifyRecordPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 核销记录 Mapper
 *
 * @author 山野羡民
 */
@Mapper
public interface TradeVerifyRecordMapper extends BaseMapperX<TradeVerifyRecordDO> {

    default PageResult<TradeVerifyRecordDO> selectPage(TradeVerifyRecordPageReqVO reqVO) {
        return selectPage(reqVO, new CoreLambdaQueryWrapper<TradeVerifyRecordDO>()
                .eqIfPresent(TradeVerifyRecordDO::getUserId, reqVO.getUserId())
                .eqIfPresent(TradeVerifyRecordDO::getShopId, reqVO.getShopId())
                .eqIfPresent(TradeVerifyRecordDO::getBizType, reqVO.getBizType())
                .eqIfPresent(TradeVerifyRecordDO::getBizId, reqVO.getBizId())
                .eqIfPresent(TradeVerifyRecordDO::getCode, reqVO.getCode())
                .likeIfPresent(TradeVerifyRecordDO::getVerifierName, reqVO.getVerifierName())
                .likeIfPresent(TradeVerifyRecordDO::getVerifierMobile, reqVO.getVerifierMobile())
                .betweenIfPresent(TradeVerifyRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TradeVerifyRecordDO::getId));
    }

}